﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ServiceModel;
using QuizSilverlight.QuizReference;
using System.Diagnostics;
using System.Net.Browser;


namespace QuizSilverlight
{
    public partial class MainPage : UserControl
    {
        QuizServiceClient client;
        public MainPage()
        {
            InitializeComponent();
            bool registerResult = WebRequest.RegisterPrefix("http://", WebRequestCreator.ClientHttp);
            client = new QuizServiceClient();


            client.LogInUserCompleted += new EventHandler<LogInUserCompletedEventArgs>(client_LogInUserCompleted);
            user r = new user();
            r.Username = "admin";
            r.Password = "1111";
            client.LogInUserAsync(r);
        }

        void client_LogInUserCompleted(object sender, LogInUserCompletedEventArgs e)
        {
            if (e.Error != null)
                textBlock1.Text = e.Error.Message;
            else
                textBlock1.Text = e.Result.ToString();
        }

 

      

 
      






    }
}
